<template>
  <div class="app-container inspecjhxq">
    <el-dialog
      title="详情"
      :visible.sync="centerDialogVisible"
      width="75%"
      :close-on-click-modal="false"
      :modal-append-to-body="false"
      :before-close="close"
      class="dialog"
      
      >
      <div style="max-width:1000px;margin:auto;">
        <p class="shenqing">
          <span>基础信息</span>
        </p>
        <table border="1" rules="all" class="tablestylejh">
          <tr>
            <td class="nameinput">计划名称</td>
            <td  colspan="3" class="neiinput">
              {{zerenOptions.planName}}
            </td>
          </tr>
          <tr class="xunzhong">
            <td class="nameinput">计划编号</td>
            <td class="neiinput">   {{zerenOptions.planCoder}}</td>
            <td class="nameinput">责任人</td>
            <td class="neiinput"> {{zerenOptions.nickName}}</td>
          </tr>
          <tr>
            <td class="nameinput">开始执行时间</td>
            <td class="neiinput"> {{zerenOptions.startDate}}</td>
            <td class="nameinput">结束执行时间</td>
            <td class="neiinput">{{zerenOptions.endDate}}</td>
          </tr>
          <tr class="xunzhong">
            <td class="nameinput">巡检周期</td>
            <td class="neiinput">
              {{zerenOptions.pollingPeriod}}
              <span v-show="zerenOptions.pollingPeriodUnit==1">天</span>
              <span v-show="zerenOptions.pollingPeriodUnit==2">周</span>
              <span v-show="zerenOptions.pollingPeriodUnit==3">月</span>
            </td>
            <td class="nameinput">有效时间</td>
            <td class="neiinput">
              {{zerenOptions.validTime}}
              <span v-show="zerenOptions.validTimeUnit==1">小时</span>
              <span v-show="zerenOptions.validTimeUnit==2">天</span>
              <span v-show="zerenOptions.validTimeUnit==3">周</span>
              <span v-show="zerenOptions.validTimeUnit==4">月</span>
            </td>
          </tr>
          <tr>
            <td class="nameinput">是否启用</td>
            <td colspan="3" class="neiinput">
              <span v-show="zerenOptions.isStartUsing=='0'">未启用</span>
              <span v-show="zerenOptions.isStartUsing=='1'">已启用</span>
            </td>
          </tr>
          <tr class="xunzhong">
            <td class="nameinput">说明</td>
            <td  colspan="3" style="width: 1030px;padding-left: 10px">
              {{zerenOptions.explain}}
            </td>
          </tr>
        </table>
        <p class="shenqing">责任人</p>
        <el-table
          :data="zerenOptions.devicePollingResponsibilityUserVos"
          border
          stripe
          style="width: 1196px;margin-left: 15px">
          <el-table-column
            type="index"
            label="序号"
            align="center"
            width="50">
          </el-table-column>
          <el-table-column  align="center"  prop="nickName" label="姓名" ></el-table-column>
          <el-table-column  align="center"  prop="sex" label="性别">
            <template slot-scope="scope" >
              <span v-show="scope.row.sex=='0'">男</span>
              <span v-show="scope.row.sex=='1'">女</span>
              <span v-show="scope.row.sex=='2'">未知</span>
            </template>
          </el-table-column>
          <el-table-column  align="center"  prop="aptitudes" label="资质证书" :show-overflow-tooltip="true"></el-table-column>
        </el-table>
        <p class="shenqing">执行信息</p>
        <table border="1" rules="all" class="tablestylejh">
          <tr>
            <td class="nameinput">已过期</td>
            <td class="neiinput">
              {{zerenOptions.staleDated}}
            </td>
          </tr>
          <tr class="xunzhong">
            <td class="nameinput">实际执行周期</td>
            <td class="neiinput">
              {{zerenOptions.completed}}
            </td>
          </tr>
          <tr>
            <td class="nameinput">总点检次数</td>
            <td class="neiinput">
              {{zerenOptions.spotCheckNumder}}
            </td>
          </tr>
          <tr>
            <td class="nameinput">故障次数</td>
            <td class="neiinput">
              {{zerenOptions.abnormalNumder}}
            </td>
          </tr>
          <tr>
            <td class="nameinput">完好率</td>
            <td class="neiinput">
              {{zerenOptions.intact}}
            </td>
          </tr>
        </table>
        <p class="shenqing">巡检路线</p>
      <el-table
        :data="zerenOptions.devicePollingPathVos"
        border
        stripe
        style="width: 1196px;margin-left: 15px">
        <el-table-column
          type="index"
          label="序号"
          align="center"
          width="50">
        </el-table-column>
        <el-table-column
          prop="deviceCode"
          label="设备编号"
          align="center"
          width="180">
          <template slot-scope="scope" >
            <span style="color: #196fef;cursor:pointer;" >{{scope.row.deviceCode}}</span>
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          prop="deviceName"
          label="设备名称">
        </el-table-column>
        <el-table-column
          align="center"
          prop="deptName"
          label="所属单位">
        </el-table-column>
        <el-table-column
          align="center"
          prop="deviceTypeName"
          label="类别">
        </el-table-column>
        <el-table-column
          align="center"
          prop="deviceModel"
          label="规格型号">
        </el-table-column>
        <el-table-column
          align="center"
          prop="standard"
          label="标准">
        </el-table-column>
        <el-table-column
          align="center"
          prop="repositoryName"
          label="存放地点">
        </el-table-column>
      </el-table>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import request from '@/utils/request'
  export default {
    name: "Role",
    props:['pid'],
    data() {

      return {
        centerDialogVisible:true,
        loading:false,
        total:0,
        zerenOptions:{
          planName:'',
          predictStartTime:'',
          predictEndTime :'',
          practicalStartTime:'',
          practicalEndTime:'',
          taskStatus:'',
          delayDays:'',
          abnormalDeviceNumber:'',
          lackExamineDeviceNumber:'',
          remark:'',
          deviceInspectionTasksPathVos:[],//巡检路线
          devicePollingResponsibilityUserVos:[],//责任人
        },
      };
    },
    created() {
      console.log('接受数据',this.pid)
      this.getTaskList()
    },
    methods: {

      getTaskList() {
        request({
          url: '/device/devicePollingPlan/' + this.pid,
          method: 'get',
        }).then(response => {
          this.zerenOptions = response.data
        });
      },
      close(){
        this.$emit('subSetChane')
      }
    }
  };
</script>
<style lang="scss">
.inspecjhxq{
  .dialog .el-dialog__body{
      height: 85vh;
      overflow: scroll;
  }
  .shenqing{
    color: #05A380;
    font-weight: 700;
    margin-left: 15px;
  }
  .tablestylejh {
    margin-left: 15px;
    border: 1px solid #cccccc;
    color: #606266;
    font-size: inherit;
    width: 100%;
  }
  .xunzhong {
    background: #f6f8f9;
  }
  .neiinput {
    padding-left: 10px;
  }
  .nameinput {
    width: 150px;
    height: 34px;
    text-align: center;
  }
  .fujian span{
    margin-left: 15px;
    cursor: pointer;
  }
  .inpturight{
    text-align: right;padding-right: 10px
  }
}
  
</style>
